<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input v-focus>
        <div v-ba="pink">自定义私有指令</div>
    </div>
        <script src="vue.js"></script>
    <script>
        Vue.directive("focus",{
            bind:function(){
                console.log("bing");
            },
            inserted:function(el){
                console.log(inserted);
                el.focus();
            },
            update:function(){
                console.log(update);
            }
        });
        var vm = new Vue({
            el:"#app",
            date:{},
            directives:{
                "ba":function(){
                    //指令属性值为一个对象 里面包含多个钩子函数
                    //如果是一个函数，则表示update必须有有值，即指令属性有属性值
                    console.log(bind);
                }
            }
        });
            
    </script>
</body>
</html>